[XEN] Extend the range returned by KEXEC_RANGE_MA_XEN to cover the
authorIan Campbell <ian.campbell@xensource.com>
Thu, 1 Feb 2007 16:07:22 +0000 (16:07 +0000)
committerIan Campbell <ian.campbell@xensource.com>
Thu, 1 Feb 2007 16:07:22 +0000 (16:07 +0000)
heap as well as code+data. This makes kdump work again after
13546:d86a96ca47a3

Also fix sizeof_note to correctly calculate the length of the name
field.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
xen/common/kexec.c

index ca729d10c1c9d2b34637db1fe4c764ef5643a1ea..a9e85cad7fc27eef1b2df756502b80fcf1a53a7b 100644 (file)
@@ -141,7 +141,7 @@ static void setup_note(Elf_Note *n, const char *name, int type, int descsz)
 static int sizeof_note(const char *name, int descsz)
 {
     return (sizeof(Elf_Note) +
-            ELFNOTE_ALIGN(sizeof(name)) +
+            ELFNOTE_ALIGN(strlen(name)+1) +
             ELFNOTE_ALIGN(descsz));
 }
 
@@ -163,7 +163,7 @@ static int kexec_get(reserve)(xen_kexec_range_t *range)
 static int kexec_get(xen)(xen_kexec_range_t *range)
 {
     range->start = virt_to_maddr(_start);
-    range->size = (unsigned long)_end - (unsigned long)_start;
+    range->size = (unsigned long)xenheap_phys_end - (unsigned long)range->start;
     return 0;
 }